#include <stdio.h>  
int main(void) {  
    int x1, x2, y1, y2;  
    scanf("%d,%d\n%d,%d", &x1, &y1, &x2, &y2);  
    while (x2 >= x1 && y2 >= y1) {  
        if (x1 == x2 && y1 == y2) {  
            printf("Yes.\n");  
            return 0;  
        }  
        if (x2 > y2) {  
            x2 -= y2;  
        } else {  
            y2 -= x2;  
        }  
    }  
    printf("No.\n");  
    return 0;  
}  